'
浮动文本，用于显示数字或文本
'

extends Node2D

func _ready() -> void:
	pass

#显示文本功能
func start(text:String) -> void:
	$Label.text = text
	var tween = self.create_tween()
	tween.set_parallel()#设置多运行函数
	tween.tween_property(self, "global_position", global_position + (Vector2.UP * 24), .3)\
	.set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_CUBIC)
	
	tween.chain()#结束多运行函数
	
	tween.tween_property(self, "global_position", global_position + (Vector2.UP * 40), .3)\
	.set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_CUBIC)
	tween.tween_property(self, "scale", Vector2.ZERO, .1)\
	.set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_CUBIC).set_delay(.2)
	tween.chain()
	tween.tween_callback(queue_free)
	
	var scale_tween = self.create_tween()
	scale_tween.tween_property(self, "scale", Vector2.ONE * 1.5, .15)\
	.set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_CUBIC)
	
	scale_tween.tween_property(self, "scale", Vector2.ONE, .15)\
	.set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_CUBIC)
	pass
